<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_validator = $show_scroll = $show_dialog = 1;
include $this->admin_tpl('header', 'admin');
?>
<h3 style="padding-left: 20px;padding-top: 10px">
<a href="javascript:history.back(-1);" style="font-size:14px;color: #0000FF"><em>返回上一级</em></a>
</h3>
<form method="post" action="" id="myform">
<input type="hidden" name="check_id" value="<?php echo $id?>">
	<div class="pad-10">
		<div class="col-tab">
		<?php if($_GET['check_status']==3){?>
		<div style="font-size: 16px;"><span style="color:green">通过<?php echo $_GET['name']?>的认证</span>，请填写审核意见</div>
		<?php }elseif ($_GET['check_status']==2){?>
		<div style="font-size: 16px;"><span style="color:red">驳回<?php echo $_GET['name']?>的认证</span>，请填写审核意见</div>
		<?php }?>
			<div id="div_info_1" class="contentList pad-10">
				<table width="100%" class="table_form ">
					<tbody>
						<tr>
							<th width="200"><?php echo L('audit_opinion')?>：</th>
							<td><textarea name="audit_opinion" id="audit_opinion" rows="10" cols="20"></textarea></td>
							<input type="hidden" name="check_status" value="<?php echo $_GET['check_status']?>">
						</tr>
						<tr> 
							<th></th> 
							<td> 
							<button type="button" onclick="audit(<?php echo $id?>,<?php echo $_GET['check_status']?>)"><?php echo L('submit')?></button>
							</td> 
						</tr>
					</tbody>
				</table>
			</div>
		</div>
</div>
</form>
<script type="text/javascript">
$(document).ready(function(){
	refreshDataRedis('<?php echo 'authentication:authentication_hash:createdBy_'.$_GET['created_by']?>');
});
function audit(id,check_status){
	var id = id;
	var status = check_status;
	var audit_opinion = $("#audit_opinion").val();
	if(status==2){
		if(audit_opinion==""){
			alert('审核内容不能为空！');
			return false;
		}
	}
	$.ajax({
		type:"POST",
		url:"?m=user_info&c=manage&a=audit_check&pc_hash=<?php echo $_SESSION['pc_hash']?>",
		data:{"check_id":id,"audit_opinion":audit_opinion,"check_status":status},
		dataType:"JSON",
		beforeSend:function(){
			art.dialog({
				id:"test",
				title:"认证审核",
				content:"审核中......请稍候",
				cancel:false
			});
		},
		success:function(result){
			if(result.status=='200'){
				window.location.href="?m=user_info&c=manage&a=audit_list&pc_hash=<?php echo $_SESSION['pc_hash']?>"
			}else{
				alert('认证审核失败');
				return false;
			}
		},
		complete:function(){
			art.dialog({id:"test"}).close();
		},
	});
}
<?php if($_GET['check_status']==2){?>
$(document).ready(function(){
	$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'220',height:'70'}, function(){this.close();$(obj).focus();})}});
    $('#audit_opinion').formValidator({
    	autotip:false,
    	onshow:'<?php echo '请输入审核内容'?>',
    	onfocus: '<?php echo '请输入审核内容'?>',
    	oncorrect: '<?php echo '正确'?>',
       	}).inputValidator(
    			{min:1,onerror:"<?php echo '审核内容不能为空！'?>"});
});
<?php }else{?>
<?php }?>
</script>
</body>
</html>